<?php 

class Model_Category {
    
    public function add($title, $link){
        $catTbl = new Model_DbTable_Categories();
        $row = $catTbl->createRow();
        $row->title = $title;
        $row->link = $link;
        return $row->save();                
    }
    
    public function getByLink($link){
        $catTbl = new Model_DbTable_Categories();
        $row = $catTbl->fetchRow("`link` = '$link'");
        return $row;        
    }    
    
    
}